﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibGreen.Oscar.ObjectManagers.SSI
{
	/// <summary>
	/// Encapsulates an SSI item representing a single Permit item
	/// </summary>
	public class Permit : IServerSideItem
	{
		/// <summary>
		/// The contact name associated with item
		/// </summary>
		public string Name;

		/// <summary>
		/// The unique ID of the item
		/// </summary>
		public readonly ushort ID;

		/// <summary>
		/// Creates a new SSIPermitDeny object
		/// </summary>
		/// <param name="id">The ItemID for the object</param>
		public Permit (ushort id)
		{
			this.ID = id;
		}

		#region IServerSideItem Members

		/// <summary>
		/// The unique ID of the item
		/// </summary>
		public ushort ItemID
		{
			get { return ID; }
		}

		#endregion

		#region IComparable Members
		/// <summary>
		/// Compares the current instance with another object of the same type.
		/// </summary>
		/// <param name="obj">An object to compare with this instance.</param>
		/// <returns>A 32-bit signed integer that indicates the relative order of the objects being compared.</returns>
		public int CompareTo (object obj)
		{
			if (obj is Permit) {
				return this.ID.CompareTo ((obj as Permit).ID);
			}
			return -1;
		}

		#endregion
	}
}
